#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

int main()
{
	vector<int> v = { 1,2,3,4,5 };
	cout << (v.rbegin().base() == v.end()) << endl;
	cout << (v.rend().base() == v.begin()) << endl;

	for (vector<int>::reverse_iterator it = v.rbegin(); it != v.rend(); ++it)
		cout << *it << " ";

	cout << endl;

	for_each(v.rbegin(), v.rend(),
		[](int& i) { cout << i << " "; });

	cout << endl;

	string s1 = "abc";
	string s2(s1.rbegin(), s1.rend());
	cout << s2 << endl;

	return 0;
}